/*
 * @Description: 周计划数据模型
 * @Author: wind-lc
 * @version: 1.0
 * @Date: 2023-03-14 14:45:49
 * @LastEditTime: 2023-03-23 10:00:55
 * @FilePath: \cscec-pms-admin\src\views\construction\weekPlan\model.js
 */

import SelectOfWeek from '@/components/Select/SelectOfWeek'
// 搜索项
const searchOption = [
  {
    name: '项目名称',
    value: 'projectName',
    type: 'input'
  },
  {
    name: '项目业态',
    value: 'formatId',
    type: 'select',
    data: []
  },
  {
    name: '所属周',
    valueKey: 'belongWeek',
    type: SelectOfWeek
  }
]
// 周计划列表表头
const columns = [
  {
    title: '单位',
    fixed: 'left',
    width: 320,
    dataIndex: 'name',
    ellipsis: true
  },
  {
    title: '项目业态',
    width: 200,
    dataIndex: 'projectFormats'
  },
  {
    title: '所属周',
    width: 200,
    dataIndex: 'week'
  },
  {
    title: '本周节点总数',
    width: 200,
    dataIndex: 'thisWeekTotalNum'
  },
  {
    title: '本周未完成节点数',
    width: 200,
    dataIndex: 'thisWeekIncompleteNum'
  },
  {
    title: '累计节点总数',
    width: 200,
    dataIndex: 'accumulationTotalNum'
  },
  {
    title: '累计未完成节点数',
    width: 200,
    dataIndex: 'accumulationIncompleteNum'
  },
  {
    title: '状态 ',
    width: 140,
    dataIndex: 'status',
    scopedSlots: { customRender: 'status' },
  },
  {
    title: '操作',
    fixed: 'right',
    dataIndex: 'operation',
    width: 170,
    scopedSlots: { customRender: 'operation' },
  }
]
// 状态
const statusMap = {
  '0': { text: '待提交', status: 'warning', },
  '1': { text: '审批中', status: 'processing', },
  '2': { text: '审批通过', status: 'success', },
  '3': { text: '审批不通过', status: 'error', }
}
// 搜索节点管控级别下拉
const nodeControlLevelList = [
  {
    value: 'FIRST_LEVEL_NODE',
    label: '一级节点'
  },
  {
    value: 'TWO_LEVEL_NODE',
    label: '二级节点'
  },
  {
    value: 'THIRD_LEVEL_NODE',
    label: '三级节点'
  }
]
// 周计划表头
const columns1 = [
  {
    title: '编号',
    width: 80,
    align: 'center',
    dataIndex: 'sortNum',
  },
  {
    title: '阶段/类别',
    width: 400,
    dataIndex: 'phaseCategory'
  },
  {
    title: '业务事项',
    width: 200,
    dataIndex: 'businessMatters'
  },
  {
    title: '管控级别',
    width: 200,
    dataIndex: 'controlLevelId'
  },
  {
    title: '周期(天)',
    dataIndex: 'period'
  },
  {
    title: '计划开始时间',
    width: 150,
    dataIndex: 'planStartTime'
  },
  {
    title: '计划完成时间',
    width: 150,
    dataIndex: 'planEndTime'
  },
  {
    title: '完成标准',
    width: 150,
    dataIndex: 'completeStandard'
  },
  {
    title: '验证资料',
    width: 150,
    dataIndex: 'verifyFiles'
  },
  {
    title: '第一责任人',
    width: 300,
    dataIndex: 'firstResName'
  },
  {
    title: '直接责任人',
    width: 300,
    dataIndex: 'directResPerList'
  }
]
// 节点状态列表下拉
const nodeStatusList = [
  {
    value: 'NOT_IMPLEMENTED',
    label: '待进行'
  },
  {
    value: 'IS_IN',
    label: '正进行'
  },
  {
    value: 'IN_REVIEW_COMPLETE',
    label: '完成审批中'
  },
  {
    value: 'DELAY_NOT_FINISH',
    label: '逾期未完成'
  },
  {
    value: 'ON_TIME_FINISH',
    label: '按期完成'
  },
  {
    value: 'DELAY_FINISH',
    label: '逾期完成'
  },
  {
    value: 'REVIEW_NOT_FINISH',
    label: '审批不通过'
  },
]
// 节点信息搜索项
const searchOption1 = [
  {
    name: '业务事项',
    value: 'businessMatters',
    type: 'input'
  }
]
// 周计划实施管理详情表头
const columns2 = [
  {
    title: '编号',
    width: 100,
    align: 'center',
    dataIndex: 'sortNum',
  },
  {
    title: '阶段/类别',
    width: 260,
    dataIndex: 'phaseCategory'
  },
  {
    title: '业务事项',
    width: 200,
    dataIndex: 'businessMatters'
  },
  {
    title: '管控级别',
    width: 80,
    dataIndex: 'controlLevelId'
  },
  {
    title: '周期(天)',
    width: 80,
    dataIndex: 'period'
  },
  {
    title: '计划开始时间',
    width: 120,
    dataIndex: 'planStartTime'
  },
  {
    title: '计划完成时间',
    width: 120,
    dataIndex: 'planEndTime'
  },
  {
    title: '实际完成时间',
    width: 120,
    dataIndex: 'completeTime'
  },
  {
    title: '完成标准',
    width: 150,
    dataIndex: 'completeStandard'
  },
  {
    title: '验证资料',
    width: 150,
    dataIndex: 'verifyFiles'
  },
  {
    title: '第一责任人',
    width: 200,
    dataIndex: 'firstResName'
  },
  {
    title: '直接责任人',
    width: 120,
    dataIndex: 'directResPerList'
  },
  {
    title: '复核情况',
    width: 200,
    dataIndex: 'reviewStatus'
  },
  {
    title: '复核人',
    width: 120,
    dataIndex: 'reviewEmployeeName'
  },
  {
    title: '节点状态',
    width: 120,
    dataIndex: 'nodeStatusName'
  },
]
// 节点完成(逾期)表单项
const formOption = [
  {
    title:'节点基本信息'
  },
  {
    label: '工程名称',
    keyName: 'projectName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '业务事项',
    keyName: 'businessMatters',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '阶段/类别',
    keyName: 'phaseCategory',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '管控级别',
    keyName: 'controlLevelName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '周期',
    keyName: 'period',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '计划开始时间',
    keyName: 'planStartTime',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '计划完成时间',
    keyName: 'planEndTime',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '亮灯情况',
    slot: true,
    keyName: 'promptLights'
  },
  {
    label: '节点状态',
    keyName: 'nodeStatusName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '实际完成时间',
    keyName: 'completeDate',
    slot: true,
    type: 'a-date-picker',
    rules: [{ required: true, message: '请选择实际完成时间', trigger: 'change' }],
  },
  {
    label: '验收资料',
    keyName: 'verifyFiles',
    type: 'BaseTextarea',
    span: 24,
    disabled: true
  },
  {
    label: '完成标准',
    keyName: 'completeStandard',
    type: 'BaseTextarea',
    span: 24,
    disabled: true
  },
  {
    label: '第一责任人',
    keyName: 'firstResName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '直接责任人',
    keyName: 'directResPerList',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '节点完成维护人',
    keyName: 'creatorName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '节点完成维护时间',
    keyName: 'createTime',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '逾期类别',
    slot: true,
    keyName: 'delayTypes',
    span: 24,
    rules: [{ required: true, message: '请选择逾期类别', trigger: 'change' }]
  },
  {
    label: '逾期原因',
    keyName: 'delayReason',
    type: 'BaseTextarea',
    span: 24,
    rules: [{ required: true, message: '请输入逾期原因', trigger: 'change' }]
  },
  {
    title:'有效赶工措施'
  },
  {
    label: '劳动力赶工费用(万元)',
    keyName: 'laborResFee',
    type: 'BaseInputNumber',
    precision: 6,
    rules: [{ required: true, message: '请输入劳动力赶工费用(万元)', trigger: 'change' }],
  },
  {
    label: '机械设备赶工费用(万元)',
    keyName: 'equipResFee',
    type: 'BaseInputNumber',
    precision: 6,
    rules: [{ required: true, message: '请输入机械设备赶工费用(万元)', trigger: 'change' }],
  },
  {
    label: '材料赶工费用(万元)',
    keyName: 'materialResFee',
    type: 'BaseInputNumber',
    precision: 6,
    rules: [{ required: true, message: '请输入材料赶工费用(万元)', trigger: 'change' }],
  },
  {
    label: '安全管理赶工费用(万元)',
    keyName: 'safetyMeasureFee',
    type: 'BaseInputNumber',
    precision: 6,
    rules: [{ required: true, message: '请输入安全管理赶工费用(万元)', trigger: 'change' }],
  },
  {
    label: '预计赶工费用(万元)',
    keyName: 'rushFee',
    type: 'BaseInputNumber',
    precision: 6,
    disabled: true
  },
  {
    label: '劳动力资源',
    keyName: 'laborRes',
    type: 'BaseTextarea',
    rules: [{ required: true, message: '请输入劳动力资源', trigger: 'change' }],
    span: 24
  },

  {
    label: '机械设备资源',
    keyName: 'equipRes',
    type: 'BaseTextarea',
    rules: [{ required: true, message: '请输入机械设备资源', trigger: 'change' }],
    span: 24
  },

  {
    label: '材料资源',
    keyName: 'materialRes',
    type: 'BaseTextarea',
    rules: [{ required: true, message: '请输入材料资源', trigger: 'change' }],
    span: 24
  },
  {
    label: '安全管理措施',
    keyName: 'safetyMeasure',
    type: 'BaseTextarea',
    rules: [{ required: true, message: '请输入安全管理措施', trigger: 'change' }],
    span: 24
  }
]
// 节点完成(未逾期)表单项
const formOption1 = [
  {
    title: '节点基本信息'
  },
  {
    label: '工程名称',
    keyName: 'projectName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '业务事项',
    keyName: 'businessMatters',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '阶段/类别',
    keyName: 'phaseCategory',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '管控级别',
    keyName: 'controlLevelName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '周期',
    keyName: 'period',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '计划开始时间',
    keyName: 'planStartTime',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '计划完成时间',
    keyName: 'planEndTime',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '亮灯情况',
    slot: true,
    keyName: 'promptLights'
  },
  {
    label: '节点状态',
    keyName: 'nodeStatusName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '实际完成时间',
    keyName: 'completeDate',
    slot: true,
    type: 'a-date-picker',
    rules: [{ required: true, message: '请选择实际完成时间', trigger: 'change' }],
  },
  {
    label: '验收资料',
    keyName: 'verifyFiles',
    type: 'BaseTextarea',
    span: 24,
    disabled: true
  },
  {
    label: '完成标准',
    keyName: 'completeStandard',
    type: 'BaseTextarea',
    span: 24,
    disabled: true
  },
  {
    label: '第一责任人',
    keyName: 'firstResName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '直接责任人',
    keyName: 'directResPerList',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '备注',
    keyName: 'delayReason',
    type: 'BaseTextarea',
    span: 24,
    rules: [{ required: true, message: '请输入备注', trigger: 'change' }]
  },
  {
    label: '节点完成维护人',
    keyName: 'creatorName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '节点完成维护时间',
    keyName: 'createTime',
    type: 'BaseInput',
    disabled: true
  }
]
// 管控级别
const controlLevelList = [
  {
    value: '1',
    label: '一级节点'
  },
  {
    value: '2',
    label: '二级节点'
  },
  {
    value: '3',
    label: '三级节点'
  }
]
// 完成标准
const completeStandardList = ['验收照片及现场照片', '分包单位合同签订完成,具备进厂配合条件', '验收通过文件']
// 验证资料
const verifyFilesList = ['验收资料扫描件', '合同扫描件', '验收通过文件扫描件']
// 周计划看板
const masterPlanList = [
  {
    label: '节点按时完成率',
    value: void 0,
    img: require('@/assets/masterPlan-1.png')
  },
  {
    label: '节点完成率',
    value: void 0,
    img: require('@/assets/masterPlan-2.png')
  },
  {
    label: '逾期一级节点数',
    value: void 0,
    valueKey:'FIRST_LEVEL_NODE',
    img: require('@/assets/masterPlan-3.png')
  },
  {
    label: '逾期二级节点数',
    value: void 0,
    valueKey:'TWO_LEVEL_NODE',
    img: require('@/assets/masterPlan-4.png')
  },
  {
    label: '逾期三级节点数',
    value: void 0,
    valueKey:'THIRD_LEVEL_NODE',
    img: require('@/assets/masterPlan-5.png')
  }
]
// 复核状态列表
const reviewStatusList = [
  {
    value: null,
    label: '全部'
  },
  {
    value: 0,
    label: '未复核'
  },
  {
    value: 1,
    label: '复核不通过'
  },
  {
    value: 2,
    label: '复核通过'
  },
]
export{
  searchOption,
  columns,
  statusMap,
  nodeControlLevelList,
  columns1,
  nodeStatusList,
  columns2,
  formOption,
  formOption1,
  controlLevelList,
  completeStandardList,
  verifyFilesList,
  masterPlanList,
  searchOption1,
  reviewStatusList
}